/*
 * @Description: 生成IService
 * @Author: DHL
 * @Date: 2022-01-30 14:20:12
 * @LastEditors: DHL
 * @LastEditTime: 2022-07-20 13:12:45
 */

import { firstToUpperCase, firstToLowerCase } from '../../utils/codeGenUtils'

export function createIService(codeGenConfig: any) {
  const classNameFirstToUpperCase = firstToUpperCase(codeGenConfig.className)
  const classNameFirstToLowerCase = firstToLowerCase(codeGenConfig.className)
  const className = 'I' + codeGenConfig.className + 'Service'

  return `
package ${codeGenConfig.packageName}.service;

import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import ${codeGenConfig.packageName}.entity.${classNameFirstToLowerCase}.${classNameFirstToUpperCase};
import ${codeGenConfig.packageName}.entity.${classNameFirstToLowerCase}.dto.Search${classNameFirstToUpperCase}Dto;
import ${codeGenConfig.packageName}.entity.${classNameFirstToLowerCase}.vo.Save${classNameFirstToUpperCase}Vo;
import ${codeGenConfig.packageName}.entity.${classNameFirstToLowerCase}.vo.Search${classNameFirstToUpperCase}Vo;
import ${codeGenConfig.packageName}.entity.${classNameFirstToLowerCase}.vo.Update${classNameFirstToUpperCase}ByIdVo;
import com.twb.core.base.entity.TwbPageInfo;
import com.twb.core.base.service.IBaseService;

/**
 * @ClassName: ${className}
 * @Description: ${codeGenConfig.genName}
 * 
 * @author ${codeGenConfig.genAuthor}
 * @date ${codeGenConfig.createData}
 */
public interface ${className} extends IBaseService<${classNameFirstToUpperCase}> {
  
  /**
   * @Title: search${classNameFirstToUpperCase}
   * @Description: 分页查询
   * @param vo
   * @return
   * @author ${codeGenConfig.genAuthor}
   * @date ${codeGenConfig.createData}
   */
  public TwbPageInfo<Search${classNameFirstToUpperCase}Dto> search${classNameFirstToUpperCase}(Search${classNameFirstToUpperCase}Vo vo);

  /**
   * @Title: search${classNameFirstToUpperCase}Sum
   * @Description: 列表查询合计（含查询条件）
   * @param vo
   * @return
   * @author ${codeGenConfig.genAuthor}
   * @date ${codeGenConfig.createData}
   */
  public Search${classNameFirstToUpperCase}Dto search${classNameFirstToUpperCase}Sum(Search${classNameFirstToUpperCase}Vo vo);

  /**
   * @Title: save${classNameFirstToUpperCase}
   * @Description: 保存信息
   * @param vo
   * @return
   * @author ${codeGenConfig.genAuthor}
   * @date ${codeGenConfig.createData}
   */
  public boolean save${classNameFirstToUpperCase}(Save${classNameFirstToUpperCase}Vo vo);

  /**
   * @Title: update${classNameFirstToUpperCase}ById
   * @Description: 更新信息
   * @param vo
   * @return
   * @author ${codeGenConfig.genAuthor}
   * @date ${codeGenConfig.createData}
   */
  public boolean update${classNameFirstToUpperCase}ById(Update${classNameFirstToUpperCase}ByIdVo vo);

  /**
   * @Title: delete${classNameFirstToUpperCase}ByIds
   * @Description: 批量删除信息
   * @param ids
   * @return
   * @author ${codeGenConfig.genAuthor}
   * @date ${codeGenConfig.createData}
   */
  public boolean delete${classNameFirstToUpperCase}ByIds(String ids);

  /**
   * @Title: logicBatchDelete${classNameFirstToUpperCase}ByIds
   * @Description: 批量逻辑删除
   * @param ids
   * @return
   * @author ${codeGenConfig.genAuthor}
   * @date ${codeGenConfig.createData}
   */
  public int logicBatchDelete${classNameFirstToUpperCase}ByIds(String ids);

  /**
   * @Title: exportExcel
   * @Description: 导出excel
   * @param exportExcelVo
   * @param searchVo
   * @return
   * @author ${codeGenConfig.genAuthor}
   * @date ${codeGenConfig.createData}
   */
  public void exportExcel(Search${classNameFirstToUpperCase}Vo vo, HttpServletResponse response) throws Exception;

}
`
}
